using Avalonia.Controls;
using Avalonia.Input;
using JGSY.AI.DesktopUI.ViewModels;

namespace JGSY.AI.DesktopUI.Views;

public partial class SettingsWindow : Window
{
    public SettingsWindow()
    {
        InitializeComponent();
        SetupWindowDragging();
    }

    private void SetupWindowDragging()
    {
        var dragArea = this.FindControl<Border>("DragArea");
        if (dragArea != null)
        {
            dragArea.PointerPressed += (sender, e) =>
            {
                if (e.GetCurrentPoint(this).Properties.IsLeftButtonPressed)
                {
                    BeginMoveDrag(e);
                }
            };
        }
    }
}
